<?xml version="1.0" ?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      >
    <head>
        <meta http-equiv="Content-Type" content="text/html;"/>
        <link href="css/testcenter.css" rel="stylesheet" type="text/css"/>
        <title>Test Center Module</title>
    </head>
    <body>
        <h:form>

            <rich:panel>
                <f:facet name="header" styleClass="headLbl">
                    Test Center Operation
                </f:facet>
                <h:outputLabel styleClass="subHeadLbl">Create a TestCenter by clicking 'Create/Add'</h:outputLabel>
                <h:panelGrid id="createTC" columns="2" border="0">
                    <h:outputLabel  value="Name : " ></h:outputLabel>
                    <rich:inplaceInput id="name" defaultLabel="Enter TestCenter Name :" value="#{testcenteraction.testCenter.name}" required="true"/>
                    <h:outputLabel  value="Location : " ></h:outputLabel>
                    <rich:inplaceInput id="loc" defaultLabel="Enter Location :" value="#{testcenteraction.testCenter.location}" required="true"/>
                    <h:outputLabel  value="No. Of WorkStations : " ></h:outputLabel>
                    <rich:inplaceInput id="wccount" defaultLabel="Enter No. Of Workstations:" value="#{testcenteraction.testCenter.workStationCount}" required="true"/>
                    <h:outputLabel  value="WorkStation Name: " ></h:outputLabel>
                    <rich:inplaceInput id="wcname" defaultLabel="Work Station Name:" value="#{testcenteraction.workStation.name}" required="true"/>
                    <h:outputLabel  value="IP Adrress: " ></h:outputLabel>
                    <rich:inplaceInput id="ipaddress" defaultLabel="IP Address:" value="#{testcenteraction.workStation.ipAddress}" required="true"/>
                    <h:outputLabel  value="Operating System: " ></h:outputLabel>
                    <h:selectOneListbox value="#{testcenteraction.workStation.os}" required="yes">
                        <f:selectItem itemLabel="Windows 2000" itemValue="Windows 2000"/>
                        <f:selectItem itemLabel="Windows Vista" itemValue="Windows Vista"/>
                        <f:selectItem itemLabel="Windows XP" itemValue="Windows XP"/>
                        <f:selectItem itemLabel="Linux" itemValue="Linux"/>
                    </h:selectOneListbox>
                    <h:commandButton action="#{testcenteraction.addTestCenter}" value="Create/Add" ></h:commandButton>
                </h:panelGrid>
            </rich:panel>
        </h:form>
        <h:form>
            <rich:panel id="tclisting">
                <f:facet name="header">
                    Test Center Listing
                </f:facet>
                <rich:dataTable value="#{testCenters}" var="tc">

                    <rich:column>

                        <f:facet name="header">
                            Name
                        </f:facet>
                        <rich:inplaceInput value="#{tc.name}" id="tcname" required="true"></rich:inplaceInput>

                    </rich:column>
                    <rich:column>
                        <f:facet name="header">
                            Location
                        </f:facet>
                        <rich:inplaceInput value="#{tc.location}" id="location" required="true"></rich:inplaceInput>
                    </rich:column>
                    <rich:column>
                        <f:facet name="header">
                            No. Of WorkStations
                        </f:facet>
                        <rich:inplaceInput value="#{tc.workStationCount}" id="workstationcount" required="true"></rich:inplaceInput>
                    </rich:column>
                    <rich:column>
                        <f:facet name="header">
                            Work Station Details
                        </f:facet>

                        <rich:dataTable value="#{tc.workStations}" var="workstation">
                            <rich:column>

                                <f:facet name="header">
                                    Name
                                </f:facet>
                                <rich:inplaceInput value="#{workstation.name}" id="wcname" required="true" immediate="true"></rich:inplaceInput>

                            </rich:column>
                            <rich:column>
                                <f:facet name="header">
                                    IP Address
                                </f:facet>
                                <rich:inplaceInput value="#{workstation.ipAddress}" id="ipaddress" required="true" immediate="true"></rich:inplaceInput>

                            </rich:column>
                            <rich:column>
                                <f:facet name="header">
                                    Operating System
                                </f:facet>
                                <h:selectOneListbox value="#{workstation.os}" required="yes" immediate="true">
                                    <f:selectItem itemLabel="Windows 2000" itemValue="Windows 2000"/>
                                    <f:selectItem itemLabel="Windows Vista" itemValue="Windows Vista"/>
                                    <f:selectItem itemLabel="Windows XP" itemValue="Windows XP"/>
                                    <f:selectItem itemLabel="Linux" itemValue="Linux"/>
                                </h:selectOneListbox>
                            </rich:column>

                        </rich:dataTable>
                    </rich:column>


                    <rich:column>
                        <f:facet name="header">
                            Operations
                        </f:facet>
                        <h:commandButton action="#{testcenteraction.updateTestCenter}" value="Update" ></h:commandButton>
                        <h:outputLabel  value=" " ></h:outputLabel>
                        <h:commandButton action="#{testcenteraction.deleteTestCenter}" value="Delete"></h:commandButton>
                        <h:outputLabel  value=" " ></h:outputLabel>
                        <a4j:commandButton action="#{testcenteraction.addWorkStation}" value="Add WorkStation" immediate="true" reRender="tclisting"></a4j:commandButton>
                    </rich:column>
                </rich:dataTable>
            </rich:panel>

        </h:form>
    </body>
</html>
